package com.imooc.hystrix;

import com.imooc.hystrix.service.MyService;
import feign.Feign;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

@SpringBootApplication
// 微服务客户端
@EnableDiscoveryClient
//fen
@EnableFeignClients
//断路器 ，服务降级
@EnableCircuitBreaker
public class  HystrixApplication {

    public static void main(String[] args) throws NoSuchMethodException {
        System.out.printf(Feign.configKey(MyService.class,MyService.class.getMethod("timeOut",Integer.class)));
        SpringApplication.run(HystrixApplication.class, args);
    }

}
